package service

import (
	"gorm.io/gorm"
	"week_three/user_srv/models"
)

func GetUserByUsername(username string) (*models.User, error) {
	user := new(models.User)
	return user, models.InitMysql(func(DB *gorm.DB) error {
		return DB.Where("username = ?", username).First(&user).Error
	})
}
